home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d16
/
winutil3.arc
/
WINSTART.ARC
/
WINSTART.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-11-01
|
2KB
|
70 lines
/*
* WINSTART.C Charles Puffe 9-18-90
*
* A C utility program to start the version of Windows 3.0
* that you desire upon bootup.
*
* This program requires the Window Boss (c) libraries to be
* compiled.
*/
#include "windows.h"
#include <process.h>
#define PROG "C:\\WINDOWS\\WIN.COM"
main()
{
WINDOWPTR w1; /* window handle */
char ch;
int batrib; /* border atrib */
int watrib; /* window atrib */
/*
* Set attributes:
*
* border - blue/white box
* window - blue background/white letters
*
*/
batrib = v_setatr(BLUE,WHITE,0,0);
watrib = v_setatr(BLUE,WHITE,0,0);
/*
* Open window at 0,0 - 40 cells wide and 12 cells high
*/
w1 = wn_open(0,0,0,40,12,watrib,batrib);
if(!w1) exit(1);
/*
* Print text to window, wait for key to be struck,
* execute the version of Windows desired and exit.
*/
wn_printf(w1,"Windows 3.0 Startup Utility\n\n");
wn_printf(w1," Selections :\n\n");
wn_printf(w1," R) Real Mode\n\n");
wn_printf(w1," S) Standard Mode\n\n");
wn_printf(w1," E) 386 Enhanced Mode\n\n");
wn_printf(w1," Press the letter of your choice,\n or any other key for DOS...");
ch = v_getch();
switch ( ch )
{
case 'R' :
execlp ( PROG, PROG, "/r", NULL );
break;
case 'S' :
execlp ( PROG, PROG, "/s", NULL );
break;
case 'E' :
execlp ( PROG, PROG, "/3", NULL );
break;
case 'r' :
execlp ( PROG, PROG, "/r", NULL );
break;
case 's' :
execlp ( PROG, PROG, "/s", NULL );
break;
case 'e' :
execlp ( PROG, PROG, "/3", NULL );
break;
default:
break;
}
wn_close(w1);
}